Connect Algolia to your headless Salesforce B2C Commerce using a React frontend.
create-next-app
command-line tool.
my-react-storefront
and starts a local development server on http://localhost:3000/
.
unified-instantsearch-ecommerce/src/config/settings.js
and make the following changes:
__primary_category.*
:
price.${currency}
:
<Hit>
component:
<Hit>
component includes code for sending click events when users select a product in the search results.
unified-instantsearch-ecommerce/export
with all assets.
Copy this directory to the public
directory of your storefront project.
<Search />
component<Search />
component in the components
directory.
Search.js
:
<Search />
component in your storefrontpages/index.js
with your <Home />
component and add your <Search />
component to it.